/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.tcr.entities;

import android.provider.ContactsContract.CommonDataKinds.Note;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Sangre
 */
public class Enseigne implements Serializable {

    private static final long serialVersionUID = 1L;
    
    private Long id;
    private String nom;
    private String description;
    private String adresse;
    private String ville;
    private String pays;

    private Date dateCreation;
    private List<String> lstImage = new ArrayList<String>();
    private String imageProfil = "";
    private String video = "";
    private double latitude;
    private double longitude;
    
    private double noteCumulee = 0;
    private double note = 0;
    
    private Collection<Actualite> actualites = new ArrayList();
    
    private Collection<Commentaire> commentaires = new ArrayList();
    
    private Collection<Note> notes = new ArrayList();
    
    private  Commercant commercant;
    
    private Collection<Client> clients = new ArrayList();
    
    public Enseigne() {
    }

    public Enseigne(String nom, String description, String ville, String adresse, String pays, java.util.Date dateCreation, java.util.List lstImage, java.lang.String video, double lat, double lon) {
        this.nom = nom;
        this.description = description;
        this.adresse = adresse;
        this.ville = ville;
        this.pays = pays;
        
        this.dateCreation = dateCreation;
        this.lstImage = lstImage;
        this.video = video;
        this.latitude = lat;
        this.longitude = lon;
    }
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * Get the value of nom
     *
     * @return the value of nom
     */
    public String getNom() {
        return nom;
    }

    /**
     * Set the value of nom
     *
     * @param nom new value of nom
     */
    public void setNom(String nom) {
        this.nom = nom;
    }

    /**
     * Get the value of description
     *
     * @return the value of description
     */
    public String getDescription() {
        return description;
    }

    /**
     * Set the value of description
     *
     * @param description new value of description
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * Get the value of adresse
     *
     * @return the value of adresse
     */
    public String getAdresse() {
        return adresse;
    }

    public String getVille() {
        return ville;
    }

    public void setVille(String ville) {
        this.ville = ville;
    }
    

    /**
     * Set the value of adresse
     *
     * @param adresse new value of adresse
     */
    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public Collection<Actualite> getActualites() {
        return actualites;
    }

    public void setActualites(Collection<Actualite> actualites) {
        this.actualites = actualites;
    }

    public Collection<Commentaire> getCommentaires() {
        return commentaires;
    }

    public void setCommentaires(Collection<Commentaire> commentaires) {
        this.commentaires = commentaires;
    }

    public Date getDateCreation() {
        return dateCreation;
    }

    public void setDateCreation(Date dateCreation) {
        this.dateCreation = dateCreation;
    }

    public List<String> getLstImage() {
        return lstImage;
    }
    
    public String getImageProfil() {
        if(lstImage.size()>0)
            imageProfil = lstImage.get(0);
        return imageProfil;
    }
    
    public void ajouteImage(String img) {
        this.lstImage.add(img);
    }

    public void setLstImage(List<String> lstImage) {
        this.lstImage = lstImage;
    }

    public String getVideo() {
        return video;
    }

    public void setVideo(String video) {
        this.video = video;
    }

    public Collection<Note> getNotes() {
        return notes;
    }

    public void setNotes(Collection<Note> notes) {
        this.notes = notes;
    }

    public double getCumulNote() {
        return noteCumulee;
    }

    public void setCumulNote(double cumulNote) {
        this.noteCumulee = cumulNote;
    }

    public double getNote() {
        return note;
    }

    public void setNote(double note) {
        this.note = note;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public String getPays() {
        return pays;
    }

    public void setPays(String pays) {
        this.pays = pays;
    }

    public Commercant getCommercant() {
        return commercant;
    }

    public void setCommercant(Commercant commercant) {
        this.commercant = commercant;
    }

    public Collection<Client> getClients() {
        return clients;
    }

    public void setClients(Collection<Client> clients) {
        this.clients = clients;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Enseigne)) {
            return false;
        }
        Enseigne other = (Enseigne) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Enseigne[ id=" + id + " ]";
    }
}
